package top.hepingan.java.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.hepingan.java.common.Result;
import top.hepingan.java.entity.RedPacket;
import top.hepingan.java.mapper.IRedPacketService;
import top.hepingan.java.utils.UserUtils;

/**
 * @author cxyck
 */
@RequestMapping("/RedPacket")
@RestController
@Slf4j
@RequiredArgsConstructor
public class RedPacketController   {
    @Autowired
    private  IRedPacketService redPacketService;
    /**
     * 获取红包
     * @param redPacket
     * @return
     */
    @RequestMapping
    public Result getRedPacket(RedPacket redPacket){
        log.info("获取红包");
        //是否大量
      Long userId =  UserUtils.getCurrentLoginId();

        return  redPacketService.getRedPacket(redPacket,userId);


    }


    /**
     * 查看红包列表
     */

    /**
     * 红包详情
     */

}
